﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>隐藏字段</title>
    <link href="../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Scripts/bootstrap/js/jquery.min.js"></script>
    <script type="text/javascript" src="../../Scripts/bootstrap/js/bootstrap.min.js"></script>
    <script src="../../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../Scripts/config.js" type="text/javascript"></script>

      <script type="text/javascript">
          /* ESC Key Down */
          function Esc() {
              if (event.keyCode == 27)
                  window.close();
              return true;
          }
          function Edit(fk_mapdata, mypk, ftype) {
              var url = '../../Comm/En.htm?EnsName=BP.Sys.FrmUI.MapAttrStrings&DoType=Edit&FK_MapData=' + fk_mapdata + '&MyPK=' + mypk + '&FType=' + ftype;
              window.location.href = url;
          }
          function EditEnum(mypk, refno, ftype) {

              var url = '../../Comm/En.htm?EnsName=BP.Sys.FrmUI.MapAttrEnums&DoType=Edit&FK_MapData=' + fk_mapdata + '&MyPK=' + mypk + '&FType=' + ftype;
              window.location.href = url;
          }
          function EditTable(mypk, refno, ftype) {
              var url = '../../Comm/En.htm?EnsName=BP.Sys.FrmUI.MapAttrSFTable&DoType=Edit&FK_MapData=' + fk_mapdata + '&MyPK=' + mypk + '&FType=' + ftype;
              window.location.href = url;
          }

          //页面启动函数.
          $(function () {

              $("#Msg").html("<img src=../../Img/loading.gif />&nbsp;正在加载,请稍后......");

              InitPage();

              $("#Msg").html("");
          });

          //初始化数据.
          function InitPage() {

              var fk_mapData = GetQueryString("FK_MapData");

              //初始化表格.
              $.ajax({
                  type: 'post',
                  async: true,
                  url: Handler + "?DoType=HidAttr&FK_MapData=" + fk_mapData + "&m=" + Math.random(),
                  dataType: 'html',
                  success: function (data) {

                      data = JSON.parse(data);

                      var idx = 0;
                      //增加处理.
                      for (var i = 0; i < data.length; i++) {

                          //屏蔽掉不需要显示的.
                          var keyOfEn = data[i].KeyOfEn;
                          switch (keyOfEn) {
                              case "BatchID":
                              case "OID":
                              case "FID":
                              case "FK_NY":
                              case "RefPK":
                              case "Emps":
                              case "FK_Dept":
                              case "WFState":
                              case "RDT":
                              case "MyNum":
                              case "Rec":
                              case "CDT":
                                  continue;
                              default:
                                  break;
                          }

                          var dataType = data[i].MyDataType;
                          var name = data[i].Name;
                          var myPK = data[i].MyPK;

                          var editLink = "";


                          switch (data[i].LGType) {
                              case 0:
                                  editLink = "<a href=\"javascript:Edit('" + fk_mapData + "','" + myPK + "','" + dataType + "')\"''>" + name + "</a>";
                                  break;
                              case 1:
                                  editLink = "<a href=\"javascript:EditEnum('" + fk_mapData + "','" + myPK + "','" + dataType + "')\"''>" + name + "</a>";
                                  break;
                              default:
                                  editLink = "<a href=\"javascript:EditTable('" + fk_mapData + "','" + myPK + "','" + dataType + "')\"''>" + name + "</a>";
                                  break;
                          }

                          idx++;
                          var newRow = "<tr ><td class=Idx>" + idx + "</td><td>" + keyOfEn + "</td><td>" + editLink + "</td><td>" + data[i].LGTypeText + "</td> <td>" + data[i].MyDataType + "</td> </tr>";

                          $("#Table1 tr:last").after(newRow);
                      }
                  }
              });
          }
</script>
<base target="_self" />

</head>
<body>

<table id="Table1" name="Table1" style="width:80%;" >
<caption>隐藏字段</caption>
<tr>
<th>IDX</th>
<th>字段 </th>
<th>名称(点击编辑) </th>
<th>类型 </th>
<th>数据类型 </th>
</tr>

</table>
 
<div id="Msg"></div>

</body>
</html>
